<?php

namespace common\models\ar;

use Yii;

/**
 * This is the model class for table "money_in_out".
 *
 * @property int $id
 * @property int $uid_operate 操作的账户ID
 * @property int $userID 受操作的账户ID
 * @property string $money 变更金额，正数
 * @property int $time 操作时间
 * @property int $direction 操作方向，见money_change_direction表
 * @property int $type 操作方式，1人工，2系统
 * @property int $status 交易系统操作状态，0发起请求，1操作成功，2操作失败
 * @property string $ip IP信息
 * @property string $ua user_agent信息
 * @property string $remark 操作备注
 * @property string $response 向交易系统操作资金失败的信息，status=2时有用
 */
class MoneyInOut extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'money_in_out';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['uid_operate', 'userID', 'time'], 'integer'],
            [['money'], 'number'],
            [['ua', 'remark', 'response'], 'string'],
            [['direction', 'type', 'status'], 'string', 'max' => 4],
            [['ip'], 'string', 'max' => 16],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'uid_operate' => 'UidOperate',
            'userID' => 'UserID',
            'money' => 'Money',
            'time' => 'Time',
            'direction' => 'Direction',
            'type' => 'Type',
            'status' => 'Status',
            'ip' => 'Ip',
            'ua' => 'Ua',
            'remark' => 'Remark',
            'response' => 'Response',
        ];
    }
}
